package com.sct.screen;

import android.opengl.GLSurfaceView;
import android.util.Log;

import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;


/**
 * Created by a on 11/21/15.
 */
public class Screen implements GLSurfaceView.Renderer{
    private String TAG="sct";
    private int mTranslucentBackground;

    public Screen(int useTranslucentBackground)
    {
        mTranslucentBackground = useTranslucentBackground;

        ScreenJni.create();
    }

    public void onDrawFrame(GL10 gl)
    {
        ScreenJni.tryToShowOneFrame();
    }

    public void onSurfaceChanged(GL10 gl, int width, int height)
    {
        ScreenJni.configScreen(width, height, mTranslucentBackground);
    }

    public void onSurfaceCreated(GL10 gl, EGLConfig config)
    {

    }

    protected void finalize()
    {
        Log.v(TAG, "Screen finalize call");
        ScreenJni.destroy();
    }
}
